from scipy.linalg import inv
import numpy as np

# 定义矩阵
A = np.array([[1, 2], [3, 4]])

# 求逆
A_inv = inv(A)
print("Inverse of A:\n", A_inv)